package com.tour.sic.controller;

import com.tour.sic.entity.Favorite;
import com.tour.sic.service.intf.FavoriteService;
import com.tour.sic.vo.R;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @program: SIC
 * @description: 控制层实现常用的外部接口
 * @author: team
 * @create: 2021-04-22 16:25:00
 */
@RestController
@RequestMapping("/favorite/")
@Api(tags = "实现Favorite的各种操作接口")
public class FavoriteController{
    /*
    *注入业务逻辑层对象*/
    @Autowired
    private FavoriteService service;
    /*
    * 新增内容*/
    @ApiOperation(value = "实现新增",notes = "实现新增")
    @PostMapping("save.do")
    public R save(@RequestBody Favorite favorite){
       return service.save(favorite);
    }
    /*
    * 查询 所有数据*/
    @ApiOperation(value = "实现全部查询",notes = "实现全部查询")
    @GetMapping("all.do")
    public R all(){
       return service.queryAll();
    }
}